<?php
    $from_name = $_POST['txtName'];
    $from_email = $_POST['txtEmail'];
    $subject = $_POST['txtSubject'];
    $message = $_POST['elm1'];
    $is_copy = $_POST['copy'];

//    $headers = 'From: '.$from_name."\r\n";
    $headers  = "From: $from_name<$from_email>\r\n";
//    $headers .= "Reply-To: info@my_site.com\r\n";
//    $headers .= "Return-Path: info@my_site.com\r\n";
//     $headers .= "X-Mailer: Drupal\n";
    $headers .= 'MIME-Version: 1.0' . "\n";
    $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
    $to_email = 'thanhlong_vn214@yahoo.com';
    if($is_copy ==1){
        $headers .= "Cc:".$from_email;
        mail($from_email, $subject, $message, $headers);
    }
    mail($to_email, $subject, $message, $headers);
    echo '<script>window.location="../web/index.php"</script>';

?>
